package com.fingard.dsp.bank.reqrespobj.foreigncurrsingle;

import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;

import com.fingard.constant.Format;
import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.xml.XmlTextReader;

//跨境外币数据查询
public class ReqQryForeignCurrSingle extends RequestBase{

	public String askNumber;
	public String bgnDate;

	//private XmlTextReader p_xmlReader;
	public ReqQryForeignCurrSingle(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
		reqHeader = p_header;

		if(p_xmlReader.read(PATH_Detail)){//"/ATSYH/TransReq/TransParam/DetailRecord"
			askNumber = p_xmlReader.readedXElement.getSingleText("ReqSeqID");
			bgnDate = p_xmlReader.readedXElement.getSingleText("BgnDate");
		}
		else{
			throw new Exception("不存在节点："+PATH_Detail);
		}
	}
	//没用  看下删除
	public ReqQryForeignCurrSingle(HashMap<String, String> p_hashParam, ReqRespHeader p_header) throws Exception{
		reqHeader = p_header;
		//xmlReader = p_xmlReader;
		if(p_hashParam.containsKey("RdSeq")){
			askNumber = p_hashParam.get("RdSeq");
		}
		if(p_hashParam.containsKey("BgnDate")){
			bgnDate = p_hashParam.get("BgnDate");
		}
	}
	
	public Date getBgnDateTime() throws ParseException{
		return Format.DateTimeFormat.parse(bgnDate);
	}
}
